home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 April
/
Ahoy_Magazine_87-04_1987_Double_L.d64
/
Crossed Ladders
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
472b
|
21 lines
0 print"[147]":poke646,1:poke53280,0:poke53281,0
1 rem ==================================
2 rem commodares problem #36-4 :
3 rem crossed ladders
4 rem solution by
5 rem andy young
6 rem ==================================
10 ll=30 : ls=20 : ht=6 : k=2
20 x0=1 :rem initial value
30 print "x0, gx, hx"
100 for ii=0 to -1 step -1
110 hs=sqr(ls*ls-x0*x0)
120 hl=sqr(ll*ll-x0*x0)
130 hx=hs*hl/(hs+hl)
140 fx=ht-hx
150 gx=x0-fx/k
160 print x0,gx,hx
170 x0=gx
180 ii=(abs(fx/gx) < 1e-8)
190 next ii